Omplus.base.define(Omplus.controllers.Controller, {
	omplusName : "formsController"
});

Omplus.base.define(Omplus.models.Model, {
	omplusName : "FormsSearch",
	controller : "formsController",
	value : {
		"name" : {
			omplusType : "String"
		},
		"last_name" : {
			omplusType : "String"
		},
		"is_verified" : {
			omplusType : "Number",
			synchroniseWith : "Verifikacije.forForms.number"
		},
		delta : {
			omplusType : "Number",
			value : 5
		},
		start : {
			omplusType : "Number",
			value : 0
		}
	}
});

Omplus.models.FormsSearchModelProto = Omplus.base.extend(Omplus.models.Object,
		{
			omplusType : "FormsSearchModelProto",
			value : {
				"id" : {
					omplusType : "Number"
				},
				"s_name" : {
					omplusType : "String"
				},
				"s_last_name" : {
					omplusType : "String"
				},
				"i_name" : {
					omplusType : "String"
				},
				"i_last_name" : {
					omplusType : "String"
				},
				"dobijeni" : {
					omplusType : "String"
				},
				"izgubljeni" : {
					omplusType : "String"
				},
				"verified" : {
					omplusType : "String"
				}
			}
		});

Omplus.base.define(Omplus.models.Model, {
	omplusName : "FormsSearchResults",
	controller : "formsController",
	value : {
		persons : {
			omplusType : "Array",
			omplusProto : "FormsSearchModelProto"
		},
		total : {
			omplusType : "Number"
		}
	}
});

Omplus.models.PersonProto = Omplus.base.extend(Omplus.models.Model, {
	omplusType : "PersonProto",
	value : {
		"id" : {
			omplusType : "Number"
		},
		"s_name" : {
			omplusType : "String"
		},
		"s_fathers_name" : {
			omplusType : "String"
		},
		"s_last_name" : {
			omplusType : "String"
		},
		"s_birth_date" : {
			omplusType : "DateTime"
		},
		"s_birth_place" : {
			omplusType : "String"
		},
		"s_birth_municipality" : {
			omplusType : "String"
		},
		"s_living_place" : {
			omplusType : "String"
		},
		"s_living_municipality" : {
			omplusType : "String"
		},
		"s_living_address" : {
			omplusType : "String"
		},
		"status_sifra_opstine" : {
			omplusType : "Number",
			maximum : 5,
			minimum : 5
		},
		"status_br_resenja_kirs" : {
			omplusType : "String"
		},
		"status_br_resenja_opstine" : {
			omplusType : "String"
		},
		"status_datum_donosenja" : {
			omplusType : "DateTime"
		},
		"status_datum_zavodjenja" : {
			omplusType : "DateTime"
		},
		"status_registarski_broj" : {
			omplusType : "String"
		},
		"status_opstina_boravista" : {
			omplusType : "String"
		},
		"status_adresa_boravista" : {
			omplusType : "String"
		},
		"i_name" : {
			omplusType : "String"
		},
		"i_fathers_name" : {
			omplusType : "String"
		},
		"i_last_name" : {
			omplusType : "String"
		},
		"i_birth_date" : {
			omplusType : "DateTime"
		},
		"i_birth_place" : {
			omplusType : "String"
		},
		"i_birth_municipality" : {
			omplusType : "String"
		},
		"i_living_place" : {
			omplusType : "String"
		},
		"i_living_municipality" : {
			omplusType : "String"
		},
		"i_living_address" : {
			omplusType : "String"
		},
		"i_status_sifra_opstine" : {
			omplusType : "Number",
			maximum : 5,
			minimum : 5
		},
		"i_status_br_resenja_kirs" : {
			omplusType : "String"
		},
		"i_status_br_resenja_opstine" : {
			omplusType : "String"
		},
		"i_status_datum" : {
			omplusType : "DateTime"
		},
		"i_status_opstina_boravista" : {
			omplusType : "String"
		},
		"i_status_mesto_boravista" : {
			omplusType : "String"
		},
		"i_status_adresa_boravista" : {
			omplusType : "String"
		},
		"i_status_razlog_prestanka_statusa" : {
			omplusType : "String"
		},
		"id_anketar" : {
			omplusType : "Number"
		},
		"id_kontrolor" : {
			omplusType : "Number"
		},
		"anketar_username" : {
			omplusType : "String"
		},
		"anketar" : {
			omplusType : "String"
		}
	}
});

Omplus.base.define(Omplus.models.SingleChooser, {
	omplusName : "formsChooser",
	controller : "formsController",
	omplusProto : "PersonProto",
	actions : [ {
		omplusType : "Get",
		omplusName : "insertDobijeni",
		proxy : {
			omplusType : "AjaxProxy"
		},
		responseModel : "formsChooser.current",
		requestModel : "formsChooser.current"
	} ]
});

Omplus.base.define(Omplus.models.PersonProto, {
	omplusName : "NewForm",
	controller : "formsController",
	actions : [ {
		omplusType : "Get",
		omplusName : "insertDobijeni",
		proxy : {
			omplusType : "AjaxProxy"
		},
		responseModel : "NewForm",
		requestModel : "NewForm",
		callback : function(){
			Omplus.globals
			.getObject(
					"NewForm")
			.empty();
		}
	} ]
});

Omplus.views.OpeningFormsTabView = Omplus.base
		.extend(
				Omplus.views.OpeningTabView,
				{
					omplusType : "OpeningFormsTabView",
					layout : {
						omplusType : "AccordionLayout"
					},
					controller : "formsController",
					components : [
							{
								omplusName : "formsDetailsFirstPanel",
								omplusType : "AccordionPanel",
								components : [
										{
											labelModel : "Assets.list.name_label.localValue",
											model : "formsChooser.current.s_name"
										},
										{
											labelModel : "Assets.list.last_name_label.localValue",
											model : "formsChooser.current.s_last_name"
										},
										{
											labelModel : "Assets.list.fathers_name_label.localValue",
											model : "formsChooser.current.s_fathers_name"
										},
										{
											labelModel : "Assets.list.birth_date_label.localValue",
											model : "formsChooser.current.s_birth_date",
											inputType : "NewDateInput",
											maxDate : "today"
										},
										{
											labelModel : "Assets.list.birth_place_label.localValue",
											model : "formsChooser.current.s_birth_place"
										},
										{
											labelModel : "Assets.list.birth_municipality_label.localValue",
											model : "formsChooser.current.s_birth_municipality"
										},
										{
											labelModel : "Assets.list.living_place_label.localValue",
											model : "formsChooser.current.s_living_place"
										},
										{
											labelModel : "Assets.list.living_municipality_label.localValue",
											model : "formsChooser.current.s_living_municipality"
										},
										{
											labelModel : "Assets.list.living_address_label.localValue",
											model : "formsChooser.current.s_living_address"
										},
										{
											labelModel : "Assets.list.status_sifra_opstine_label.localValue",
											model : "formsChooser.current.status_sifra_opstine",
											datalist : "updateNewStatusList"
										},
										{
											omplusType : "DataList",
											omplusName : "updateNewStatusList",
											model : "Localization.opstine",
											valueName:"sifra",
											controller : "languageController",
											width : "0px"
										},
										{
											labelModel : "Assets.list.status_br_resenja_opstine_label.localValue",
											model : "formsChooser.current.status_br_resenja_opstine"
										},
										{
											labelModel : "Assets.list.status_br_resenja_kirs_label.localValue",
											model : "formsChooser.current.status_br_resenja_kirs"
										},
										{
											labelModel : "Assets.list.status_datum_donosenja_label.localValue",
											model : "formsChooser.current.status_datum_donosenja",
											inputType : "NewDateInput",
											minDate : "1992-03-01",
											maxDate : "today",
											gt : "#formsDetailsFirstPanel_field_14_input"
										},
										{
											labelModel : "Assets.list.status_datum_zavodjenja_label.localValue",
											model : "formsChooser.current.status_datum_zavodjenja",
											inputType : "NewDateInput",
											minDate : "1992-03-01",
											maxDate : "today",
											lt : "#formsDetailsFirstPanel_field_13_input"
										},
										{
											labelModel : "Assets.list.status_registarski_broj_label.localValue",
											model : "formsChooser.current.status_registarski_broj"
										},
										{
											labelModel : "Assets.list.status_opstina_boravista_label.localValue",
											model : "formsChooser.current.status_opstina_boravista"
										},
										{
											labelModel : "Assets.list.status_adresa_boravista_label.localValue",
											model : "formsChooser.current.status_adresa_boravista"
										},{
											omplusType : "Button",
											omplusName : "updatedFormStatus2Button",
											model : "Assets.list.label_save_button.localValue",
											controller : "languageController",
											width : "300px",
											click : function() {
												Omplus.globals
														.getObject("formsChooser")
														.getAction("insertDobijeni")
														.run();
												Omplus.globals.getObject("formsPanel").save();
											}
										} ],
								controller : "languageController",
								model : "Assets.list.get_status_label.localValue"
							},
							{
								omplusName : "formsDetailsSecondPanel",
								omplusType : "AccordionPanel",
								components : [
										{
											labelModel : "Assets.list.name_label.localValue",
											model : "formsChooser.current.i_name"
										},
										{
											labelModel : "Assets.list.last_name_label.localValue",
											model : "formsChooser.current.i_last_name"
										},
										{
											labelModel : "Assets.list.fathers_name_label.localValue",
											model : "formsChooser.current.i_fathers_name"
										},
										{
											labelModel : "Assets.list.birth_date_label.localValue",
											model : "formsChooser.current.i_birth_date",
											inputType : "NewDateInput",
											maxDate : "today"
										},
										{
											labelModel : "Assets.list.birth_place_label.localValue",
											model : "formsChooser.current.i_birth_place"
										},
										{
											labelModel : "Assets.list.birth_municipality_label.localValue",
											model : "formsChooser.current.i_birth_municipality"
										},
										{
											labelModel : "Assets.list.living_place_label.localValue",
											model : "formsChooser.current.i_living_place"
										},
										{
											labelModel : "Assets.list.living_municipality_label.localValue",
											model : "formsChooser.current.i_living_municipality"
										},
										{
											labelModel : "Assets.list.living_address_label.localValue",
											model : "formsChooser.current.i_living_address"
										},
										{
											labelModel : "Assets.list.status_sifra_opstine_label.localValue",
											model : "formsChooser.current.i_status_sifra_opstine",
											datalist : "updateLostStatusList"
										},
										{
											omplusType : "DataList",
											omplusName : "updateLostStatusList",
											model : "Localization.opstine",
											valueName:"sifra",
											controller : "languageController",
											width : "0px"
										},
										{
											labelModel : "Assets.list.status_br_resenja_opstine_label.localValue",
											model : "formsChooser.current.i_status_br_resenja_opstine"
										},
										{
											labelModel : "Assets.list.status_br_resenja_kirs_label.localValue",
											model : "formsChooser.current.i_status_br_resenja_kirs"
										},
										{
											labelModel : "Assets.list.status_datum_label.localValue",
											model : "formsChooser.current.i_status_datum",
											inputType : "NewDateInput",
											maxDate : "today"
										},
										{
											labelModel : "Assets.list.status_opstina_boravista_label.localValue",
											model : "formsChooser.current.i_status_opstina_boravista"
										},
										{
											labelModel : "Assets.list.status_adresa_boravista_label.localValue",
											model : "formsChooser.current.i_status_adresa_boravista"
										},
										{
											labelModel : "Assets.list.status_mesto_boravista_label.localValue",
											model : "formsChooser.current.i_status_mesto_boravista"
										},
										{
											labelModel : "Assets.list.status_razlog_prestanka_label.localValue",
											model : "formsChooser.current.i_status_razlog_prestanka_statusa"
										},{
											omplusType : "Button",
											omplusName : "updatedFormStatusButton",
											model : "Assets.list.label_save_button.localValue",
											controller : "languageController",
											width : "300px",
											click : function() {
												Omplus.globals
														.getObject("formsChooser")
														.getAction("insertDobijeni")
														.run();
												Omplus.globals.getObject("formsPanel").save();
											}
										} ],
								controller : "languageController",
								model : "Assets.list.lost_status_label.localValue"
							},
							{
								omplusName : "formsDetailsFourthPanel",
								omplusType : "AccordionPanel",
								components : [
										{
											omplusType : "Panel",
											omplusName : "ZakljucakPanel",
											components : [													
													{
														omplusType : "LabelInputPair",
														omplusName : "RemarkIme",
														model : "NewRemark.ime",
														controller : "formsController",
														labelModel : "Assets.list.name_label.localValue",
														labelController : "languageController",
														width:"300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "RemarkPrezime",
														model : "NewRemark.prezime",
														controller : "formsController",
														labelModel : "Assets.list.last_name_label.localValue",
														labelController : "languageController",
														width:"300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "RemarkImeRoditelja",
														model : "NewRemark.ime_roditelja",
														controller : "formsController",
														labelModel : "Assets.list.fathers_name_label.localValue",
														labelController : "languageController",
														width:"300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "RemarkDatum",
														model : "NewRemark.datum_rodjenja",
														controller : "formsController",
														labelModel : "Assets.list.birth_date_label.localValue",
														labelController : "languageController",
														width:"300px",
														inputType : "NewDateInput",
														maxDate : "today"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "RemarkOpstina",
														model : "NewRemark.opstina_rodjenja",
														controller : "formsController",
														labelModel : "Assets.list.birth_municipality_label.localValue",
														labelController : "languageController",
														width:"300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "RemarkOPrebivalista",
														model : "NewRemark.opstina_prebivalista",
														controller : "formsController",
														labelModel : "Assets.list.living_municipality_label.localValue",
														labelController : "languageController",
														width:"300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "RemarkAPrebivalista",
														model : "NewRemark.adresa_prebivalista",
														controller : "formsController",
														labelModel : "Assets.list.living_address_label.localValue",
														labelController : "languageController",
														width:"300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "RemarkOBoravista",
														model : "NewRemark.opstina_boravista",
														controller : "formsController",
														labelModel : "Assets.list.status_opstina_boravista_label.localValue",
														labelController : "languageController",
														width:"300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "RemarkMBoravista",
														model : "NewRemark.mesto_boravista",
														controller : "formsController",
														labelModel : "Assets.list.status_mesto_boravista_label.localValue",
														labelController : "languageController",
														width:"300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "RemarkABoravista",
														model : "NewRemark.adresa_boravista",
														controller : "formsController",
														labelModel : "Assets.list.status_adresa_boravista_label.localValue",
														labelController : "languageController",
														width:"300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "RemarkDatumZakljucka",
														model : "NewRemark.datum_zakljucka",
														controller : "formsController",
														labelModel : "Assets.list.datum_zakljucka_label.localValue",
														labelController : "languageController",
														width:"300px",
														inputType : "NewDateInput",
														maxDate : "today"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "RemarkZaFromular",
														controller : "formsController",
														labelModel : "Assets.list.za_formular_label.localValue",
														labelController : "languageController",
														width:"300px",
														inputType : "Select",
														model : "ZaFormulare",
														current : "current",
														showModel:"name",
														select : function(){
															var result = Omplus.globals.getObject("ZaFormulare.current.number").getValue();
															Omplus.globals.getObject("NewRemark.formular").setValue(result);
														}
													},
													{
														omplusType : "Button",
														omplusName : "NewZakljucakButton",
														controller : "languageController",
														model : "Assets.list.label_new_zakljucak_button.localValue",
														click : function() {
															Omplus.globals.getObject("NewRemark.zakljucak_id").empty();
															Omplus.globals.getObject("NewRemark.ime").empty();
															Omplus.globals.getObject("NewRemark.prezime").empty();
															Omplus.globals.getObject("NewRemark.ime_roditelja").empty();
															Omplus.globals.getObject("NewRemark.datum_rodjenja").empty();
															Omplus.globals.getObject("NewRemark.opstina_rodjenja").empty();
															Omplus.globals.getObject("NewRemark.opstina_prebivalista").empty();
															Omplus.globals.getObject("NewRemark.mesto_prebivalista").empty();
															Omplus.globals.getObject("NewRemark.adresa_prebivalista").empty();
															Omplus.globals.getObject("NewRemark.opstina_boravista").empty();
															Omplus.globals.getObject("NewRemark.mesto_boravista").empty();
															Omplus.globals.getObject("NewRemark.adresa_boravista").empty();
															Omplus.globals.getObject("NewRemark.datum_zakljucka").empty();
															Omplus.globals.getObject("ZaFormulare").chooseByIndex(0);
															Omplus.globals.getObject("NewRemark.formular").setValue(0);
														},
														width:"300px",
														height:"50px"
													},
													{
														omplusType : "Button",
														omplusName : "SaveZakljucakButton",
														controller : "languageController",
														model : "Assets.list.label_save_button.localValue",
														click : function() {
															Omplus.globals
															.getObject("NewRemark")
															.getAction("insert")
															.run();
															Omplus.globals.getObject("formsPanel").save();
														},
														width:"300px",
														height:"50px"
													},
													{
									                    omplusType:"Table",
									                    omplusName:"alertsListTablePanel",
									                    model :"Remarks.list",
									                    controller:"formsController",
									                    omplusProto:"RemarkRow",
									                    rowHeight:"50px",
									                    rowCellWidths:[
									                        "200px",
									                        "0px",
									                        "200px",
									                        "300px"
									                    ],
									                    width:"800px"
									                }],
											layout : {
												omplusType : "HorizontalLayout",
												width : "800px"
											}
										}, ],
								controller : "languageController",
								model : "Assets.list.zakljucak_label.localValue"
							}

					]
				});

Omplus.base.define(Omplus.models.Model, {
    omplusName:"NewRemark",
    controller:"formsController",
    value:{
    	zakljucak_id:{
            omplusType:"Number"
        },
        id:{
            omplusType:"Number",
			synchroniseWith : "formsChooser.current.id"            
        },
        ime:{
            omplusType:"String"
        },
        prezime:{
            omplusType:"String"
        },
        ime_roditelja:{
            omplusType:"String"
        },
        datum_rodjenja:{
            omplusType:"DateTime"
        },
        opstina_rodjenja:{
            omplusType:"String"
        },
        opstina_prebivalista:{
            omplusType:"String"
        },
        mesto_prebivalista:{
            omplusType:"String"
        },
        adresa_prebivalista:{
            omplusType:"String"
        },
        opstina_boravista:{
            omplusType:"String"
        },
        mesto_boravista:{
            omplusType:"String"
        },
        adresa_boravista:{
            omplusType:"String"
        },
        datum_zakljucka:{
            omplusType:"DateTime"
        },
        formular:{
            omplusType:"Number"
        }
    },
	actions : [ {
		omplusType : "Get",
		omplusName : "insert",
		proxy : {
			omplusType : "AjaxProxy"
		},
		responseModel : "Remarks",
		requestModel : "NewRemark",
		callback : function(){
			Omplus.globals.getObject("NewRemark.zakljucak_id").empty();
			Omplus.globals.getObject("NewRemark.ime").empty();
			Omplus.globals.getObject("NewRemark.prezime").empty();
			Omplus.globals.getObject("NewRemark.ime_roditelja").empty();
			Omplus.globals.getObject("NewRemark.datum_rodjenja").empty();
			Omplus.globals.getObject("NewRemark.opstina_rodjenja").empty();
			Omplus.globals.getObject("NewRemark.opstina_prebivalista").empty();
			Omplus.globals.getObject("NewRemark.mesto_prebivalista").empty();
			Omplus.globals.getObject("NewRemark.adresa_prebivalista").empty();
			Omplus.globals.getObject("NewRemark.opstina_boravista").empty();
			Omplus.globals.getObject("NewRemark.mesto_boravista").empty();
			Omplus.globals.getObject("NewRemark.adresa_boravista").empty();
			Omplus.globals.getObject("NewRemark.datum_zakljucka").empty();
			Omplus.globals.getObject("ZaFormulare").chooseByIndex(0);
			Omplus.globals.getObject("NewRemark.formular").setValue(0);
		}
	} ]
});

Omplus.base.define(Omplus.models.Model, {
    omplusName:"RemarkSearch",
    controller:"formsController",
    value:{
        id:{
            omplusType:"Number",
			synchroniseWith : "formsChooser.current.id"            
        }
    }
});

Omplus.models.RemarkProto = Omplus.base.extend(Omplus.models.Model, {
    omplusType:"RemarkProto",
    value:{
        zakljucak_id:{
            omplusType:"String"
        },
        ime:{
            omplusType:"String"
        },
        prezime:{
            omplusType:"String"
        },
        ime_roditelja:{
            omplusType:"String"
        },
        datum_rodjenja:{
            omplusType:"DateTime"
        },
        opstina_rodjenja:{
            omplusType:"String"
        },
        opstina_prebivalista:{
            omplusType:"String"
        },
        mesto_prebivalista:{
            omplusType:"String"
        },
        adresa_prebivalista:{
            omplusType:"String"
        },
        opstina_boravista:{
            omplusType:"String"
        },
        mesto_boravista:{
            omplusType:"String"
        },
        adresa_boravista:{
            omplusType:"String"
        },
        datum_zakljucka:{
            omplusType:"DateTime"
        },
        formular:{
            omplusType:"Number"
        }
    }
});

Omplus.base.define(Omplus.models.Model, {
    omplusName:"Remarks",
    controller:"formsController",
    value:{
        list:{
            omplusType:"Array",
            omplusProto:"RemarkProto"
        }
    },
	actions : [ {
		omplusType : "Get",
		omplusName : "get",
		proxy : {
			omplusType : "AjaxProxy"
		},
		responseModel : "Remarks",
		requestModel : "RemarkSearch"
	} ]
});

Omplus.models.ZaFormulareProto = Omplus.base.extend(Omplus.models.Model, {
    omplusType:"ZaFormulareProto",
    value:{
        name:{
            omplusType:"String"
        },
        number:{
            omplusType:"Number"
        }
    }
});

Omplus.base.define(Omplus.models.SingleChooser, {
    omplusName:"ZaFormulare",
    controller:"formsController",
    omplusProto:"ZaFormulareProto"
});



Omplus.views.RemarkRow = Omplus.base.extend(Omplus.views.TableRow, {
    omplusType:"RemarkRow",
    components:[
        {
            omplusType:"Label",
            omplusName:"ime",
            model:"ime"
        },
        {
            omplusType:"HiddenInput",
            omplusName:"zakljucak_id",
            model:"zakljucak_id"
        },
        {
            omplusType:"Label",
            omplusName:"prezime",
            model:"prezime"
        },
        {
            omplusType:"Button",
            omplusName:"detalji",
            model:"Assets.list.details_label.localValue",
            controller:"languageController",
            click: function(){
            	var array = $(this).closest(".tableRow").attr("id").split("_");
                var row = array[array.length - 1];
            	var result = Omplus.globals.getObject("Remarks.list").getMemberByIndex(row).getValue();
            	Omplus.globals.getObject("NewRemark").setValue(result);
            	var za = Omplus.globals.getObject("NewRemark.formular").getValue();
            	Omplus.globals.getObject("ZaFormulare").chooseByIndex(za);
            }
        }
        ]
});

Omplus.base
		.define(
				Omplus.views.ManagementPanel,
				{
					omplusName : "formsPanel",
					controller : "formsController",
					renderTo : "managements",
					models : {
						chooser : "formsChooser",
						search : "FormsSearch",
						searchResult : "FormsSearchResults",
						searchResultList : "persons",
						forDisplay : "id"
					},
					views : {
						chooser : {
							title : "Assets.list.forms_label.localValue",
							components : [ {
								omplusName : "fromsTabs",
								omplusType : "OpeningTabPanel",
								omplusProto : "OpeningFormsTabView",
								controller : "formsController",
								model : "formsChooser",
								showModel : "id",
								onChange : function() {
									Omplus.globals.getObject("ZaFormulare").setValue({
										list : [
										        {
										        	name : "Dobijanje statusa",
										        	number : 0
										        },
										        {
										        	name : "Gubljenje statusa",
										        	number : 1
										        }
										]
									});
									Omplus.globals.getObject("ZaFormulare").chooseByIndex(0);
									Omplus.globals.getObject("NewRemark.formular").setValue(0);
									Omplus.globals
									.getObject("Remarks")
									.getAction("get")
									.run();
									Omplus.globals.getObject("NewRemark.zakljucak_id").empty();
									Omplus.globals.getObject("NewRemark.ime").empty();
									Omplus.globals.getObject("NewRemark.prezime").empty();
									Omplus.globals.getObject("NewRemark.ime_roditelja").empty();
									Omplus.globals.getObject("NewRemark.datum_rodjenja").empty();
									Omplus.globals.getObject("NewRemark.opstina_rodjenja").empty();
									Omplus.globals.getObject("NewRemark.opstina_prebivalista").empty();
									Omplus.globals.getObject("NewRemark.mesto_prebivalista").empty();
									Omplus.globals.getObject("NewRemark.adresa_prebivalista").empty();
									Omplus.globals.getObject("NewRemark.opstina_boravista").empty();
									Omplus.globals.getObject("NewRemark.mesto_boravista").empty();
									Omplus.globals.getObject("NewRemark.adresa_boravista").empty();
									Omplus.globals.getObject("NewRemark.datum_zakljucka").empty();
								}
							} ]
						},
						search : [
								{
									model : "FormsSearch.name",
									labelModel : "Assets.list.name_label.localValue"
								},
								{
									model : "FormsSearch.last_name",
									labelModel : "Assets.list.last_name_label.localValue"
								},
								{
									labelModel : "Assets.list.verified_label.localValue",
									labelController : "languageController",
									inputType : "Select",
									model : "Verifikacije",
									current : "forForms",
									showModel : "text",
									controller : "languageController"
								},
								{
									// Per page
									inputType : "Select",
									model : "PerPages",
									showModel : "number",
									current : "forForms",
									controller : "languageController",
									labelModel : "Assets.list.label_per_page.localValue",
									perPage : true
								},
								{
									// Search button
									inputType : "Button",
									controller : "languageController",
									model : "Assets.list.label_search_button.localValue",
									cssClasses : [ "search-button" ],
									labelWidth : "0%",
									inputWidth : "100%",
									searchButton : true
								} ],
						searchResult : [
								{
									labelModel : "Assets.list.person_id_label.localValue",
									width : "100px",
									omplusType : "Label",
									model : "id"
								},
								{
									labelModel : "Assets.list.name_label.localValue",
									width : "120px",
									omplusType : "Label",
									model : "s_name"
								},
								{
									labelModel : "Assets.list.last_name_label.localValue",
									width : "120px",
									omplusType : "Label",
									model : "s_last_name"
								},
								{
									labelModel : "Assets.list.name_label.localValue",
									width : "120px",
									omplusType : "Label",
									model : "i_name"
								},
								{
									labelModel : "Assets.list.last_name_label.localValue",
									width : "150px",
									omplusType : "Label",
									model : "i_last_name"
								},
								{
									labelModel : "Assets.list.dobijen_short_label.localValue",
									width : "80px",
									omplusType : "Label",
									model : "dobijeni"
								},
								{
									labelModel : "Assets.list.izgubljen_short_label.localValue",
									width : "80px",
									omplusType : "Label",
									model : "izgubljeni"
								},
								{
									omplusType : "Button",
									model : "Assets.list.details_label.localValue",
									width : "180px",
									controller : "languageController",
									getDetails : true,
									errorable : false
								} ]
					},
					components : [
							{
								omplusType : "TabPanel",
								omplusName : "addFormsPanel",
								layout : {
									omplusType : "AccordionLayout"
								},
								controller : "languageController",
								model : "Assets.list.new_label.localValue",
								components : [
										{
											omplusName : "newStatusFirstPanel",
											omplusType : "AccordionPanel",
											components : [
													{
														omplusType : "LabelInputPair",
														omplusName : "addFormStatusName",
														labelModel : "Assets.list.name_label.localValue",
														labelController : "languageController",
														model : "NewForm.s_name",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "addFormStatusLastName",
														labelModel : "Assets.list.last_name_label.localValue",
														labelController : "languageController",
														model : "NewForm.s_last_name",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "addFormStatusFathersName",
														labelModel : "Assets.list.fathers_name_label.localValue",
														labelController : "languageController",
														model : "NewForm.s_fathers_name",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "addFormStatusBirthDate",
														labelModel : "Assets.list.birth_date_label.localValue",
														labelController : "languageController",
														model : "NewForm.s_birth_date",
														controller : "formsController",
														width : "300px",
														inputType : "NewDateInput",
														maxDate : "today"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "addFormStatusBirthPlace",
														labelModel : "Assets.list.birth_place_label.localValue",
														labelController : "languageController",
														model : "NewForm.s_birth_place",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "addFormStatusBirthMunicipality",
														labelModel : "Assets.list.birth_municipality_label.localValue",
														labelController : "languageController",
														model : "NewForm.s_birth_municipality",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "addFormStatusLivingPlace",
														labelModel : "Assets.list.living_place_label.localValue",
														labelController : "languageController",
														model : "NewForm.s_living_place",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "addFormStatusLivingMunicipality",
														labelModel : "Assets.list.living_municipality_label.localValue",
														labelController : "languageController",
														model : "NewForm.s_living_municipality",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "addFormStatusLivingAddress",
														labelModel : "Assets.list.living_address_label.localValue",
														labelController : "languageController",
														model : "NewForm.s_living_address",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "addFormStatusSifraOpstine",
														labelModel : "Assets.list.status_sifra_opstine_label.localValue",
														labelController : "languageController",
														model : "NewForm.status_sifra_opstine",
														controller : "formsController",
														width : "300px",
														datalist : "addFormStatusSifraOpstineList"
													},
													{
														omplusType : "DataList",
														omplusName : "addFormStatusSifraOpstineList",
														model : "Localization.opstine",
														valueName:"sifra",
														controller : "languageController",
														width : "0px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "addFormStatusBrResenjaOpstine",
														labelModel : "Assets.list.status_br_resenja_opstine_label.localValue",
														labelController : "languageController",
														model : "NewForm.status_br_resenja_opstine",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "addFormStatusBrResenjaKirs",
														labelModel : "Assets.list.status_br_resenja_kirs_label.localValue",
														labelController : "languageController",
														model : "NewForm.status_br_resenja_kirs",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "addFormStatusDatumDonosenja",
														labelModel : "Assets.list.status_datum_donosenja_label.localValue",
														labelController : "languageController",
														model : "NewForm.status_datum_donosenja",
														controller : "formsController",
														width : "300px",
														inputType : "NewDateInput",
														minDate : "1992-03-01",
														maxDate : "today",
														gt : "#addFormStatusDatumZavodjenja_input"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "addFormStatusDatumZavodjenja",
														labelModel : "Assets.list.status_datum_zavodjenja_label.localValue",
														labelController : "languageController",
														model : "NewForm.status_datum_zavodjenja",
														controller : "formsController",
														width : "300px",
														inputType : "NewDateInput",
														minDate : "1992-03-01",
														maxDate : "today",
														lt : "#addFormStatusDatumDonosenja_input"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "addFormStatusRegistarskiBroj",
														labelModel : "Assets.list.status_registarski_broj_label.localValue",
														labelController : "languageController",
														model : "NewForm.status_registarski_broj",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "addFormStatusOpstinaBoravista",
														labelModel : "Assets.list.status_opstina_boravista_label.localValue",
														labelController : "languageController",
														model : "NewForm.status_opstina_boravista",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "addFormStatusAdresaBoravista",
														labelModel : "Assets.list.status_adresa_boravista_label.localValue",
														labelController : "languageController",
														model : "NewForm.status_adresa_boravista",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "Button",
														omplusName : "addFormStatusButton",
														model : "Assets.list.label_save_button.localValue",
														controller : "languageController",
														width : "400px",
														click : function() {
															Omplus.globals
																	.getObject(
																			"NewForm")
																	.getAction(
																			"insertDobijeni")
																	.run();
														}
													},
													{
														omplusType : "Button",
														omplusName : "clearFormStatusButton",
														model : "Assets.list.clear_label.localValue",
														controller : "languageController",
														width : "300px",
														click : function() {
															Omplus.globals
																	.getObject(
																			"NewForm")
																	.empty();
														}
													}],
											controller : "languageController",
											model : "Assets.list.get_status_label.localValue"
										},
										{
											omplusName : "lostStatusFirstPanel",
											omplusType : "AccordionPanel",
											components : [
													{
														omplusType : "LabelInputPair",
														omplusName : "lostFormStatusName",
														labelModel : "Assets.list.name_label.localValue",
														labelController : "languageController",
														model : "NewForm.i_name",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "lostFormStatusLastName",
														labelModel : "Assets.list.last_name_label.localValue",
														labelController : "languageController",
														model : "NewForm.i_last_name",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "lostFormStatusFathersName",
														labelModel : "Assets.list.fathers_name_label.localValue",
														labelController : "languageController",
														model : "NewForm.i_fathers_name",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "lostFormStatusBirthDate",
														labelModel : "Assets.list.birth_date_label.localValue",
														labelController : "languageController",
														model : "NewForm.i_birth_date",
														controller : "formsController",
														width : "300px",
														inputType : "NewDateInput",
														maxDate : "today"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "lostFormStatusBirthPlace",
														labelModel : "Assets.list.birth_place_label.localValue",
														labelController : "languageController",
														model : "NewForm.i_birth_place",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "lostFormStatusBirthMunicipality",
														labelModel : "Assets.list.birth_municipality_label.localValue",
														labelController : "languageController",
														model : "NewForm.i_birth_municipality",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "lostFormStatusLivingPlace",
														labelModel : "Assets.list.living_place_label.localValue",
														labelController : "languageController",
														model : "NewForm.i_living_place",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "lostFormStatusLivingMunicipality",
														labelModel : "Assets.list.living_municipality_label.localValue",
														labelController : "languageController",
														model : "NewForm.i_living_municipality",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "lostFormStatusLivingAddress",
														labelModel : "Assets.list.living_address_label.localValue",
														labelController : "languageController",
														model : "NewForm.i_living_address",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "lostFormStatusSifraOpstine",
														labelModel : "Assets.list.status_sifra_opstine_label.localValue",
														labelController : "languageController",
														model : "NewForm.i_status_sifra_opstine",
														controller : "formsController",
														width : "300px",
														datalist : "lostFormStatusSifraOpstineList"
													},
													{
														omplusType : "DataList",
														omplusName : "lostFormStatusSifraOpstineList",
														model : "Localization.opstine",
														valueName:"sifra",
														controller : "languageController",
														width : "0px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "lostFormStatusBrResenjaOpstine",
														labelModel : "Assets.list.status_br_resenja_opstine_label.localValue",
														labelController : "languageController",
														model : "NewForm.i_status_br_resenja_opstine",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "lostFormStatusBrResenjaKirs",
														labelModel : "Assets.list.status_br_resenja_kirs_label.localValue",
														labelController : "languageController",
														model : "NewForm.i_status_br_resenja_kirs",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "lostFormStatusDatum",
														labelModel : "Assets.list.status_datum_label.localValue",
														labelController : "languageController",
														model : "NewForm.i_status_datum",
														controller : "formsController",
														width : "300px",
														inputType : "NewDateInput"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "lostFormStatusOpstinaBoravista",
														labelModel : "Assets.list.status_opstina_boravista_label.localValue",
														labelController : "languageController",
														model : "NewForm.i_status_opstina_boravista",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "lostFormStatusAdresaBoravista",
														labelModel : "Assets.list.status_adresa_boravista_label.localValue",
														labelController : "languageController",
														model : "NewForm.i_status_adresa_boravista",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "lostFormStatusAdresaBoravista",
														labelModel : "Assets.list.status_mesto_boravista_label.localValue",
														labelController : "languageController",
														model : "NewForm.i_status_mesto_boravista",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "LabelInputPair",
														omplusName : "lostFormStatusAdresaBoravista",
														labelModel : "Assets.list.status_razlog_prestanka_label.localValue",
														labelController : "languageController",
														model : "NewForm.i_status_razlog_prestanka_statusa",
														controller : "formsController",
														width : "300px"
													},
													{
														omplusType : "Button",
														omplusName : "addFormStatus2Button",
														model : "Assets.list.label_save_button.localValue",
														controller : "languageController",
														width : "400px",
														click : function() {
															Omplus.globals
																	.getObject(
																			"NewForm")
																	.getAction(
																			"insertDobijeni")
																	.run();
														}
													},
													{
														omplusType : "Button",
														omplusName : "clearFormStatus2Button",
														model : "Assets.list.clear_label.localValue",
														controller : "languageController",
														width : "300px",
														click : function() {
															Omplus.globals
																	.getObject(
																			"NewForm")
																	.empty();
														}
													}],
											controller : "languageController",
											model : "Assets.list.lost_status_label.localValue"
										} ]
							},

					]
				});